{itemplate 'public/header'}
<form action="./index.php?" class="form-horizontal form-filter" id="form1">
	{php echo tpl_form_filter_hidden('store/member/list');}
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
		<div class="col-sm-9 col-xs-12">
			<div class="btn-group">
				<a href="{php echo iurl('store/member/list', array('op' => 'list', 'page' => $pindex, 'keyword' => $keyword))}" class="btn {if $sort == ''}btn-primary{else}btn-default{/if}">默认</a>
				<a href="{php echo iurl('store/member/list', array('op' => 'list', 'page' => $pindex, 'keyword' => $keyword , 'sort' => 'first_order_time','sort_val' => ($sort_val ? 0 : 1)))}" class="btn {if $sort == 'first_order_time'}btn-primary{else}btn-default{/if}">首次下单时间 <i class="fa {if $sort_val == 1}fa-sort-numeric-desc{else}fa-sort-numeric-asc{/if}"></i></a>
				<a href="{php echo iurl('store/member/list', array('op' => 'list', 'page' => $pindex, 'keyword' => $keyword , 'sort' => 'last_order_time','sort_val' => ($sort_val ? 0 : 1)))}" class="btn {if $sort == 'last_order_time'}btn-primary{else}btn-default{/if}">最近一次下单时间 <i class="fa {if $sort_val == 1}fa-sort-numeric-desc{else}fa-sort-numeric-asc{/if}"></i></a>
				<a href="{php echo iurl('store/member/list', array('op' => 'list', 'page' => $pindex, 'keyword' => $keyword , 'sort' => 'success_num','sort_val' => ($sort_val ? 0 : 1)))}" class="btn {if $sort == 'success_num'}btn-primary{else}btn-default{/if}">下单总数 <i class="fa {if $sort_val == 1}fa-sort-numeric-desc{else}fa-sort-numeric-asc{/if}"></i></a>
				<a href="{php echo iurl('store/member/list', array('op' => 'list', 'page' => $pindex, 'keyword' => $keyword , 'sort' => 'success_price','sort_val' => ($sort_val ? 0 : 1)))}" class="btn {if $sort == 'success_price'}btn-primary{else}btn-default{/if}">下单总金额 <i class="fa {if $sort_val == 1}fa-sort-numeric-desc{else}fa-sort-numeric-asc{/if}"></i></a>
			</div>
		</div>
	</div>
	<div class="form-group form-inline">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">关键字</label>
		<div class="col-sm-9 col-xs-12">
			<input class="form-control" name="keyword" placeholder="输入用户名或手机号" type="text" value="{$_GPC['keyword']}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-sm-9 col-xs-12">
			<button class="btn btn-primary">筛选</button>
		</div>
	</div>
</form>
<form action="" class="form-table form" method="post">
	<div class="panel panel-table">
		<div class="panel-body table-responsive js-table">
			<table class="table table-hover">
				<thead class="navbar-inner">
				<tr>
					<th>头像</th>
					<th>昵称</th>
					<th>姓名</th>
					<th>手机号</th>
					<th>成功/取消下单</th>
					<th>首次下单时间</th>
					<th>最近一次下单时间</th>
				</tr>
				</thead>
				<tbody>
				{loop $data $dca}
				<tr>
					<td><img src="{php echo tomedia($users[$dca['uid']]['avatar']);}" alt="" width="50"/></td>
					<td>{$users[$dca['uid']]['nickname']}</td>
					<td>{$users[$dca['uid']]['realname']}</td>
					<td>{$users[$dca['uid']]['mobile']}</td>
					<td>
						<span class="label label-success">{$dca['success_num']}次 / {$dca['success_price']}元</span>
						<br>
						<span class="label label-danger label-br">{$dca['cancel_num']}次 / {$dca['cancel_price']}元</span>
					</td>
					<td>
						{if !empty($dca['first_order_time'])}
							{php echo date('Y-m-d H:i', $dca['first_order_time']);}
						{/if}
					</td>
					<td>
						{if !empty($dca['last_order_time'])}
							{php echo date('Y-m-d H:i', $dca['last_order_time']);}
						{/if}
					</td>
				</tr>
				{/loop}
				</tbody>
			</table>
			{$pager}
		</div>
	</div>
</form>
{itemplate 'public/footer'}
